import * as Webpack from "webpack";
import AppConfig from "./app.config";
import ModuleConfig from "./module.config";
import PluginConfig from "./plugin.config";
import DevConfig from "./dev.config";

const config: Webpack.Configuration = {
    entry: {
        index: AppConfig.indexJS
    },
    output: {
        filename: "assets/js/[name].[hash:8].js",
        path: AppConfig.build,
        publicPath: "/"
    },
    devtool: AppConfig.dev ? "source-map" : false,
    resolve: {
        extensions: [".ts", ".tsx", ".js", ".json"]
    },
    module: ModuleConfig,
    plugins: PluginConfig,
    devServer: DevConfig,
};

export default config;
